From: Andres Lagar-Cavilla Date: Tue, 10 Jan 2012 15:35:01 +0000 (+0000) Subject: libxc: Only retry mapping pages when ENOENT is returned X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22?a=commitdiff_plain;h=e9f7017afe06053b9f2fa297b4076cffcfbba6e2;p=xen.git libxc: Only retry mapping pages when ENOENT is returned If the return value from the ioctl() is not ENOENT, it's possible that err[i] will not be updated and libxc will just loop forever. Although it's unlikely that err[i] would not be updated after the ioctl() gets through at least once, it's better to be defensive. Signed-off-by: Adin Scannell Signed-off-by: Andres Lagar-Cavilla Committed-by: Ian Jackson --- diff --git a/tools/libxc/xc_linux_osdep.c b/tools/libxc/xc_linux_osdep.c index 115203ddb4..319997947e 100644 --- a/tools/libxc/xc_linux_osdep.c +++ b/tools/libxc/xc_linux_osdep.c @@ -232,7 +232,7 @@ static void *linux_privcmd_map_foreign_bulk(xc_interface *xch, xc_osdep_handle h do { usleep(100); rc = ioctl(fd, IOCTL_PRIVCMD_MMAPBATCH_V2, &ioctlx); - } while ( rc < 0 && err[i] == -ENOENT ); + } while ( rc < 0 && errno == ENOENT && err[i] == -ENOENT ); } }